/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: ResultMap
 * Author:   81216
 * Date:     2018/11/11 9:17
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package utils;

import java.io.Serializable;
import java.util.HashMap;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author 81216
 * @create 2018/11/11
 * @since 1.0.0
 */
    public class ResultMap extends HashMap<String, Object> implements Serializable {
        public ResultMap() {
        }

        public ResultMap msg(String msg) {
            this.put("msg", msg);
            return this;
        }

        public ResultMap fail() {
            this.put("msg", "fail");
            return this;
        }

        public ResultMap success() {
            this.put("msg", "success");
            return this;
        }

        public ResultMap code(String code) {
            this.remove("data");
            this.put("code", code);
            return this;
        }
        public ResultMap data(Object data) {
            this.put("data", data);
            return this;
        }
    }